##############################################################################
# cmake configuration file for PandoraSDK
#
# requires:
#   MacroCheckPackageLibs.cmake for checking package libraries
#
# returns following variables:
#
#   PandoraSDK_FOUND      : set to TRUE if PandoraSDK found
#       if FIND_PACKAGE called with REQUIRED and COMPONENTS arguments
#       PandoraSDK_FOUND is only set to TRUE if ALL components are also found
#       if REQUIRED is NOT set components may or may not be available
#
#   PandoraSDK_ROOT       : path to this PandoraSDK installation
#   PandoraSDK_VERSION    : package version
#   PandoraSDK_LIBRARIES  : list of PandoraSDK libraries (NOT including COMPONENTS)
#   PandoraSDK_INCLUDE_DIRS  : list of paths to be used with INCLUDE_DIRECTORIES
#   PandoraSDK_LIBRARY_DIRS  : list of paths to be used with LINK_DIRECTORIES
#   PandoraSDK_COMPONENT_LIBRARIES      : list of PandoraSDK component libraries
#   PandoraSDK_${COMPONENT}_FOUND       : set to TRUE or FALSE for each library
#   PandoraSDK_${COMPONENT}_LIBRARY     : path to individual libraries
#   PandoraSDK_${COMPONENT}_LIB_DEPENDS : individual library dependencies
#
# @author Jan Engels, Desy
##############################################################################

SET( PandoraSDK_ROOT "@CMAKE_INSTALL_PREFIX@" )
SET( PandoraSDK_VERSION "@PandoraSDK_VERSION@" )


# ---------- include dirs -----------------------------------------------------
# do not store find results in cache
SET( PandoraSDK_INCLUDE_DIRS PandoraSDK_INCLUDE_DIRS-NOTFOUND )
MARK_AS_ADVANCED( PandoraSDK_INCLUDE_DIRS )

FIND_PATH( PandoraSDK_INCLUDE_DIRS
	NAMES Pandora/Pandora.h
	PATHS ${PandoraSDK_ROOT}/include
	NO_DEFAULT_PATH
)



# ---------- libraries --------------------------------------------------------
INCLUDE( "@PANDORA_CMAKE_MODULES_PATH@/MacroCheckPackageLibs.cmake" )

# only standard libraries should be passed as arguments to CHECK_PACKAGE_LIBS
# additional components are set by cmake in variable PKG_FIND_COMPONENTS
# first argument should be the package name
CHECK_PACKAGE_LIBS( PandoraSDK PandoraSDK )




# ---------- libraries dependencies -------------------------------------------
# this sets PandoraSDK_${COMPONENT}_LIB_DEPENDS variables
INCLUDE( "${PandoraSDK_ROOT}/lib/cmake/PandoraSDKLibDeps.cmake" )
 



# ---------- final checking ---------------------------------------------------
INCLUDE( FindPackageHandleStandardArgs )
# set PANDORASDKNEW_FOUND to TRUE if all listed variables are TRUE and not empty
# PandoraSDK_COMPONENT_VARIABLES will be set if FIND_PACKAGE is called with REQUIRED argument
FIND_PACKAGE_HANDLE_STANDARD_ARGS( PandoraSDK DEFAULT_MSG PandoraSDK_ROOT PandoraSDK_INCLUDE_DIRS PandoraSDK_LIBRARIES ${PandoraSDK_COMPONENT_VARIABLES} )

SET( PandoraSDK_FOUND ${PANDORASDKNEW_FOUND} )

